package com.dangdang.threadexam;

import java.util.concurrent.FutureTask;

public class ThreadMain {
    public static void main(String[] args) {
        ThreadA threadA = new ThreadA();
        threadA.start();
        System.out.println("这是主线程");


        Thread thread = new Thread(threadA,"hello");

        ThreadB threadB = new ThreadB();
        new Thread(threadB).start();
        System.out.println("这是主线程");


        ThreadC threadC = new ThreadC();
        FutureTask<String> futureTask = new FutureTask<String>(threadC);
        new Thread(futureTask).start();
        System.out.println("这是主线程：login!");
        try {
            System.out.println("得到的返回结果是"+futureTask.get());
        }catch (InterruptedException e){
            e.printStackTrace();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
